import subprocess
import sys
import os
path=os.path.dirname(__file__)
print(path)
shell_order='python '+path+ '/use_to_test.py'
a=subprocess.Popen(shell_order,bufsize=0,stdout=subprocess.PIPE,shell=True)
for i in iter(a.stdout.readline,'b'):
    if not i:
        a.terminate()
        if subprocess.Popen.poll(a) is not None:
            break
        else:
            print("hashaki")
    print(i)


####################################################################
'''
# file name:use_to_test.py
import sys
from time import sleep

for i in range(5):
    print("hashaki")
    sleep(1)
'''
####################################################################